#ifndef GAME_H
#define GAME_H

#include <QDialog>
#include <QKeyEvent>
#include <QTimer>
#include <QLabel>
#include <QPixmap>
#include <cmath>

#include "mainmenu.h"
#include "level.h"
#include "pausemenu.h"
#include "windows.h"
#include "end.h"

class Level;

namespace Ui {
    class Game;
}

class Game : public QDialog
{
    Q_OBJECT

public:
    explicit Game(QWidget *parent, QString);
    ~Game();

    void LoadGame(int,int,int,int,int,int);
    void refreshBackground();
    void StartTimers();
    void StopTimers();

    QLabel * btn, *gmTime, *gmDeaths, *background;
    QTimer *moveT, *secT, *delayT;
    QPixmap *orb, *orb2, *orb3, *bkground;
    Level *lvl;
    int x,y, ymomentum, width, height, resY;
    int rw, lw, flX, flY, top;
    int levelN, timeCnt, deathCnt;
    bool airborn, dead;


private:
    Ui::Game *ui;
    QString file;

private slots:
    void moveBtn();
    void incTime();
    void fallDeaths();
    void incDeaths();
    void delayDeath();

protected:
    void keyPressEvent(QKeyEvent * event);

};

#endif // GAME_H
